import router from '@system.router'
export default {
  props: ['menuData', 'firstTab'],//接收数据
  data() {
    return {
      currentTab: this.firstTab//赋予firsttab的值
    }
  },
  computed: {
    tabs() {
      return Object.keys(this.menuData)//赋值
    }
  },
  handleMenuLeftClick(tab) {
    this.currentTab = tab
  },
  handleMenuRightClick(tab) {
    router.push({
      uri: 'pages/list/cb-list',//页面跳转
      params: {
        title: tab
      }
    })
  },
  onReady() {//开始遍历数据
    // console.log(JSON.stringify(this.tabs))
    this.$watch('firstTab', (newValue) => {
      this.currentTab = newValue
    })
  }
}